home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 154 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.2 KB

  1. From: lars.farm@nts.mh.se (Lars Farm)
  2. Message-ID: <AD312FF19668E835@sleipner.nts.mh.se>
  3. X-Original-Date: Sun, 28 Jan 1996 13:51:45 +0100
  4. Path: in1.uu.net!bounce-back
  5. Date: 29 Jan 96 00:03:58 GMT
  6. Approved: fjh@cs.mu.oz.au
  7. Newsgroups: comp.std.c++
  8. Subject: Re: Enhanced container functionality
  9. Organization: pv
  10. References: <ABJRD_mKQD@qsar.chem.msu.su> <3108EC3B.767@suphys.physics.su.oz.au>
  11. Content-Type: text/plain; charset=iso-8859-1
  12. Content-Transfer-Encoding: 8bit
  13. X-Auth: PGPMoose V1.1 PGP comp.std.c++
  14.     iQBFAgUBMQwO/+EDnX0m9pzZAQHQmwF+If5fL5sY521Ul6+arqKU+xO1p0bFGBTD
  15.     2ob8WsGvSaRQxnFH9PTarSuws16bOfHh
  16.     =3atw
  17.  
  18. In article <3108EC3B.767@suphys.physics.su.oz.au>,
  19. John Max Skaller <maxtal@suphys.physics.su.oz.au> wrote:
  20.  
  21. >Eugene Radchenko wrote:
  22. >> Having used the STL for some time, I have come to greatly missing:
  23. >
  24. >> First, it is the ability to (easily) flush the entire container
  25. >>   void erase() { erase(begin(), end()); }
  26. >
  27. >> Second, it is the 'post-factum' equivalents to some constructors
  28. >>   void assign(size_type n, T t = T());
  29. >>   void assign(const_iterator first, const_iterator last);
  30. >> etc. - putting the container into the same state as the one it would have
  31. >> after the respective constructor. 
  32. >> I think these features deserve inclusion.
  33. >
  34. >I find myself tending to agree -- so I'll look into
  35. >including these facilities in UESTL. It is too late
  36. >for non-essential significant changes to the C++ WP.
  37.  
  38. They are already in, according to the html-september draft 
  39. found at cygnus. Except erase() is called clear(). One example:
  40.  
  41.   23.2.3  Template class list                       [lib.list]
  42.   ...
  43.   namespace std {
  44.     template <class T, class Allocator = allocator>
  45.     class list {
  46.       ...
  47.     // _lib.list.cons_ construct/copy/destroy:
  48.       ...
  49.       template <class InputIterator>
  50.         void assign(InputIterator first, InputIterator last);
  51.       template <class Size, class T>
  52.         void assign(Size n, const T& t = T());
  53.       ...
  54.     // _lib.list.modifiers_ modifiers:
  55.       ...
  56.       void clear();
  57.  
  58.  
  59.  
  60. --
  61. Lars Farm, lars.farm@nts.mh.se
  62. ---
  63. [ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  64.   Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy
  65.   is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
  66.